<?php

function truyen_render_desktop_item($row){

	$str='';
     $str.="<div class='col-md-2 col-sm-2 col-lg-2 col-xs-12'>";
                    	  $str.="<div class='item_truyen_box'>";
                         $str.="<div class='img'>";
                          $str.="<img data-original='http://sv1.mong.vn/mong/upload/".$row['hinhanh']."'  class='img-responsive lazy' />";
                          $str.="    </div>";
                          $str .='<div class="wrap_bottom_item">';
                             //   $str.=" <div class='chuong_info'>".$row['sochuong']."/".$row['tongsochuong']."</div>";
                                $str.="<div class='title'><a href='".truyenf1_url_truyen($row['id'],$row['alias'])."'>".$row['ten']."</a></div>";
                               $str.="<div class='chuong_name'><a href='".$row['chuongmoinhat_url']."'>".$row['chuongmoinhat']."</a></div>";
                               
                                $str.="<div class='stat_info'>";
                                	 if($type==1){
                                	$str.="<span class='pull-left author'><i class='fa fa-user'></i>".$row['tacgia']."</span>";
                                	$str.="<span class='pull-left time'>".time_ago($row['time_upload'])."</span><Br/>";
                                    
                                  $str.="<span class='tags'><i class='fa fa-tags'></i>".$row['theloai2']['2']."</span>";
                                	 $str.="<div class='clearfix'></div>";
                                    
                                     }else{ 
                                   $str.="<span class='pull-left author'>".$row['tacgia']."</span>";
                                	$str.="<span class='pull-left time'>".time_ago($row['time_update'])."</span><Br/>";
                                    
                                    $str.="<span class='tags'>".$row['theloai2']['2']."</span>";
                                	 $str.="<div class='clearfix'></div>";
                                    } 
                                $str.="</div>";
                            $str .='</div>';
                       $str.=" </div><!-- End item_truyen_box -->";
                   $str.= "</div> <!-- End of col-md-3 -->";
				   
				   
				   return $str;

}

function truyen_render_desktop_items($data,$item=6){
	$num=count($data);
	$rows=ceil($num/$item);
		for($i=0;$i<$rows;$i++){
				$j=$i*$item;
				$dt=array_slice($data,$j,$item);
				$str.='<div class="panel-featured-row">';
				foreach($dt as $row){
						$str.=truyen_render_desktop_item($row);
				}
				$str.='<div class="clr"></div>';
				$str.='</div>';
		}
	return $str;			
}


function truyen_render_desktop_slide($data,$alias,$max,$title, $link = "#",$num=6,$des=''){
?>
			<div class="my-panel" id="<?php echo $alias; ?>-panel">
		          
                <input type="hidden" id="<?php echo $alias; ?>-slider-total-page" name="<?php echo $alias; ?>-slider-total-page" value="<?php echo $max; ?>" />
                <input type="hidden" id="<?php echo $alias; ?>-slider-current-page" name="<?php echo $alias; ?>-slider-current-page" value="1" />
                
                <div class="panel-truyen">
                                        <a href="<?php echo $link; ?>" class="panel-title-a"><?php echo $title;?></a> 
                                        <?php if($des!=''){ echo  '<span class="des">'.$des.'</span>';}?>
                                            <p class="panel-page" id="<?= $alias ?>-show-current-page">1</p>
                </div>
            
            
            <button type="button" class="btn btn-default slide-btn slide-btn-left" id="<?php echo $alias; ?>-btn-slider-prev" data-rel="<?php echo $alias; ?>"><i class="fa fa-arrow-circle-left fa-lg"></i></button>	
			<button type="button" class="btn btn-default slide-btn slide-btn-right" id="<?php echo $alias; ?>-btn-slider-next" data-rel="<?php echo $alias; ?>"><i class="fa fa-arrow-circle-right fa-lg"></i></button>
            
  		
                <div  id="<?php echo $alias; ?>-wrapper" class="slider-wrapper" data-href="1">
                    <div class="wrap-loading" id="wrap-<?php echo $alias; ?>-loading" style="display: none;">
                            <span class="loading" id="<?php echo $alias; ?>-loading"><img alt="loading" src="public/images/loading11.gif"></span><br>
                    </div>
                            
                    <div id="<?php echo $alias; ?>-content-slide-1" class="<?php echo $alias; ?>-content">
                        <?php echo truyen_render_desktop_items($data,$num); ?>
                    </div> <!-- End of $alias-content -->
                
                </div> <!-- End of $alias-wrapper -->
            </div> <!-- End my panel class -->
<?php }

function truyen_render_desktop_detail_box($data){?>
	 	<div class="row detail-info" id="manga-detail-info" xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Review-aggregate">
							<h1 property="v:itemreviewed"><?php echo $data['ten']; ?></h1>
							<div class="col-md-12 box" style="padding: 0px 10px;">
							<?php if($_SESSION['mobile']==0){ ?>
								<ul class="breadcrumb breadcrumb_manga" xmlns:v="http://rdf.data-vocabulary.org/#" style="margin-bottom:10px">
							<?php
							}else{ echo '<ul class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#">';
							}?>
							<li typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="<?php echo HOME; ?>"><i class="fa fa-home"></i></a></li>
							<li typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="<?php echo MANGA_URL; ?>">Truyện</a></li>
							<?php 
								$theloaiEx = explode(',', $data['theloai2']['3']);
								$theloaiName = $theloaiEx[0];
								$theloaiAlias = khongdau($theloaiEx[0]);
							?>
							 <li typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="<?php echo truyenf1_url_truyen_theloai(1,$theloaiAlias) ?>"><?= $theloaiName; ?></a></li>							<li typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="<?php echo truyenf1_url_truyen($data['id'],$data['alias']); ?>"><?= $data['ten']; ?></a></li>
				
							</ul>
							</div>
							<div class="col-md-3 col-xs-12 col-lg-3 col-sm-6 detail-info-image">
								<img rel="v:photo" src="http://sv1.mong.vn/mong/upload/<?php echo gglink($data['hinhanh']) ?>" class="img-rounded img-responsive" alt="<?php echo $data['name'] ?>" />
								<?php
								if($data['is_followed'] == false):
								?>
								<button class="btn follow-btn follow-story follow-manga-btn"><i class="fa fa-bookmark"></i> Theo dõi truyện<p class="follow-info"><?= $data['follows'] > 0 ? $data['follows'] : 0 ?> lượt theo dõi</p></button>
								<?php else: ?>
								<button class="btn follow-btn unfollow-story follow-manga-btn unfollow-btn"><i class="fa fa-ban"></i> Bỏ theo dõi<p class="follow-info"><?= $data['follows'] > 0 ? $data['follows'] : 0 ?> lượt theo dõi</p></button>
								<?php endif; ?>
								<div style="height:10px"></div>
							</div>
							
							<div class="col-md-6 col-xs-12 col-lg-6 col-sm-6 detail-info-info">
                            	<?php if($_SESSION['mobile']==0){?>
								<div role="tabpanel" class="detail-tab" id="manga-detail-tab">
									<div class="">
										<ul class="nav nav-pills">
											<li role="presentation" class="active"><a data-toggle="tab" href="#manga-detail-tab-info">Thông tin</a></li>
										
											<li role="presentation"><a data-toggle="tab" href="#manga-detail-tab-tag">Từ Khóa</a></li>
										</ul>
									</div>
									
									<div class="tab-content">
										<div class="tab-pane active fade in" id="manga-detail-tab-info">
											<table class="table">
												<tr>
													<td class="detail-info-label">Thể loại:</td>
													<td class="detail-info-content" id="detail-info-category"><?php echo $data['theloai2']['2']; ?></td>
												</tr>
												<tr>
													<td class="detail-info-label">Tác giả:</td>
													<td class="detail-info-content" id="detail-info-author"><a href="<?php echo truyenf1_url_truyen_tacgia(khongdau($data['tacgia']));?>"><?php echo $data['tacgia']; ?></a></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Tình trạng:</td>
													<td class="detail-info-content"><?php echo $data['tinhtrang-text']; ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Nguồn:</td>
													<td class="detail-info-content"><?php if($data['nguon']!=''){ echo mangaf2_get_manga_nguon($data['nguon']);}else{ echo "Đang cập nhật ...";} ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Lượt xem:</td>
													<td class="detail-info-content"><?php echo $data['views']; ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Ngày đăng:</td>
													<td class="detail-info-content"><?php echo time_ago($data['upload_time']); ?></td>
												</tr>
                                                <tr>
													<td colspan="2" style="background-color:#fefefe; padding: 10px; font-size: 17px;"><?php 
														if($data['noidung']==''){$content_show = $data['gioithieu'];}else{$content_show = $data['noidung'];}
															echo "<small>".$content_show."</small>";
														?>
                       								 </td>
													
												</tr>
											</table>
										</div>
									
										
										<div class="tab-pane fade in" id="manga-detail-tab-tag">
											<?php echo $data['gtags']; ?>
        									 <?php //echo $data['tag3']; ?>
										</div>
									</div>
								</div> <!-- End manga-detail-tab -->
                                <?php }else{
									//Neu la mobile thi ko can tab dau
									?>
                                <table class="table">
												<tr>
													<td class="detail-info-label">Thể loại:</td>
													<td class="detail-info-content" id="detail-info-category"><?php echo $data['theloai2']['2']; ?></td>
												</tr>
												<tr>
													<td class="detail-info-label">Tác giả:</td>
													<td class="detail-info-content" id="detail-info-author"><?php echo $data['tacgia']; ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Tình trạng:</td>
													<td class="detail-info-content"><?php echo $data['tinhtrang-text']; ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Nguồn:</td>
													<td class="detail-info-content"><?php if($data['nguon']!=''){ echo mangaf2_get_manga_nguon($data['nguon']);}else{ echo "Đang cập nhật ...";} ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Lượt xem:</td>
													<td class="detail-info-content"><?php echo $data['views']; ?></td>
												</tr>
												
												<tr>
													<td class="detail-info-label">Ngày đăng:</td>
													<td class="detail-info-content"><?php echo time_ago($data['upload_time']); ?></td>
												</tr>
                                                <tr>
													<td colspan="2" style="background-color:#fefefe; font-size: 13px; padding: 10px;"><?php 
														if($data['noidung']==''){$content_show = $data['gioithieu'];}else{$content_show = $data['noidung'];}
															echo "<small>".$content_show."</small>";
														?>
                       								 </td>
													
												</tr>
											</table>
                                <?php }?>
              
							</div> <!-- End col-md-6 -->
							
							<div class="col-md-3 col-xs-12 col-lg-3 col-sm-12 detail-info-metadata">
								<div id="wrap-rating" class="rating" rel="v:rating">
                                
                                	
                                	<?php 
                                	$max = $data['rate_average'];
									if($max > 5){$max=5;}
									 ?>
									<div typeof="v:Rating">
                                	<div id="rating"style="margin: 0px auto;" class="basic" data-id="1"></div>
                                	<p class="rating-count"><span property="v:votes"><?php echo $data['rate_count'] ?></span> đánh giá</p>
					   				<span>
						   				<p class="rating-point">
						   					<span property="v:average"><?php echo $max; ?></span>/<span property="v:best">5</span>
						   					<span style="display: none" property="v:worst">0</span> 
	         							</p>
	         						</span>
	         						
         							<p style="display: none; margin-top: 3px; margin-bottom: 3px;" id="rate_message"></p>
         							
         							<p class="like-info" style="margin-bottom: 3px;">Hãy like truyện để ủng hộ <?= DOMAIN_NAME; ?> cùng với nhóm dịch nhé</p>
         							<!-- Go to www.addthis.com/dashboard to customize your tools -->
								
         							<p class="comment-info">Viết bình luận cho truyện</p>
         							</div>
         							<script type="text/javascript">
         							rateDisable = false;
									if($.cookie('ranime_<?php echo $data['id']; ?>') == '1'){
					
										rateDisable = true;
									}
         							$(".basic").jRating({
										bigStarsPath : 'public/images/stars.png', // path of the icon stars.png
										smallStarsPath : 'public/images/small.png', // path of the icon small.png
										type:"big",
										length : 5,
										decimalLength : 1,
										isDisabled: rateDisable,
										step: true,
										nbRates : 3,
										rateMax : 5,
										showRateInfo:false,
										phpPath : '<?= HOME; ?>index.php?module=ajax&act=truyen&opt=rating&rating=1&case=anime&id=<?= $data['id']; ?>',
										
										onSuccess : function(data){
											
											if(data){
												if(data.type == 'success'){
													
													classMsgRating = 'rate_success';
													$.cookie('ranime_<?php echo $data['id']; ?>', '1', { expires: 30 });
												}else if(data.type == 'error'){
													classMsgRating = 'rate_error';
												}
												
												$('#rate_message').html('<p class="'+classMsgRating+'">'+data.message+'</p>');
												$('#rate_message').slideDown('normal').delay(3000).slideUp('normal');
											}
											
										  },
										
									});
								 
								</script>
                                  <script type="text/javascript">
                                  $(document).ready(function(){

  									$('.detail-info-image').on('click', '.unfollow-story', function(e){
  										e.preventDefault();
  										username = '<?= $_SESSION['user']['username']; ?>';
  										if(!username){
  											//window.location.href = '<?= LOGIN ?>';
  											popupMessage('Chưa Đăng Nhập', ['Hãy đăng nhập để có thể theo dõi truyện này'], 'alert-danger');
  											return;
  										}
  										anime_id = '<?= $data['id']; ?>';
  										username = '<?= $_SESSION['user']['username']; ?>';
  										$.ajax({
  											url: 'index.php?module=ajax&act=truyen&opt=follow_story&unfollow_story=1',
  											type: 'POST',
  											data: {anime_id: anime_id, username: username},
  											success: function(data){
  												if(data) newData = $.parseJSON(data);
  												if(newData.error){
  													popupMessage('Lỗi', [newData.error], 'alert-danger');
  												}else if(newData.message){
  													popupMessage('Thành công', ["Bạn đã hủy theo dõi truyện này thành công"], 'alert-success');
  													$('.unfollow-story').remove();
  													$('.detail-info-image').append('<button class="btn follow-btn follow-story follow-manga-btn"><i class="fa fa-bookmark"></i> Theo dõi truyện<p class="follow-info"><?= $data['follows'] > 0 ? $data['follows'] : 0 ?> lượt theo dõi</p></button>');
  													
  												}
  											},
  										});
  									});
  							
  									$('.detail-info-image').on('click', '.follow-story', function(e){
  										e.preventDefault();
  										username = '<?= $_SESSION['user']['username']; ?>';
  										if(!username){
  											//window.location.href = '<?= LOGIN ?>';
  											popupMessage('Chưa Đăng Nhập', ['Hãy đăng nhập để có thể theo dõi truyện này'], 'alert-danger');
  											return;
  										}
  										anime_id = '<?= $data['id']; ?>';
  										username = '<?= $_SESSION['user']['username']; ?>';
  										
  										$.ajax({
  											url: 'index.php?module=ajax&act=truyen&opt=follow_story&follow_story=1',
  											type: 'POST',
  											data: {anime_id: anime_id, username: username},
  											success: function(data){
  												if(data) newData = $.parseJSON(data);
  												if(newData.error){
  													popupMessage('Lỗi', [newData.error], 'alert-danger');
  												}else if(newData.message){
  													popupMessage('Thành công', ["Bạn đã đăng ký theo dõi Manga này thành công"], 'alert-success');
  													$('.follow-story').remove();
  													$('.detail-info-image').append('<button class="btn follow-btn unfollow-story follow-manga-btn unfollow-btn"><i class="fa fa-ban"></i> Bỏ theo dõi<p class="follow-info"><?= $data['follows'] > 0 ? $data['follows'] : 0 ?> lượt theo dõi</p></button>');
  												}
  											},
  										});
  									});
  							
  									
  							
  									
  							
  								});
							</script>
         						 </div> <!-- End wrap rating -->
							</div>
							<div class="clr"></div>
						</div>	
                        <?php
 
 }
 

 function truyen_render_chapter_item($data,$alias){
	
	 $str=' <div class="truyen_list">';
	 $j=1;
	
    foreach ($data as $row){
								 if($j%2==0){$str.='<div class="row row-chap ">'; }else{$str.='	<div class="row row-chap ">'; }
				 						  $str.='<div class="col-md-1 item_row">'.floatval($row['thutu']).'</div>';
										  $str.='<div class="col-md-6 item_row"> <span class="item_title2"> <a  href="'.truyenf1_url_truyen_chuong($row['id'],$row['alias'],$alias).'">'.$row['ten'].'</a></span></div>';
										  $str.=' <div class="col-md-3 ">';
										  if($row['user_upload']!=''){
										  $user=get_user_by_username($row['user_upload']);
										 	 if($user){
							$str.='<span class="item_time">'.time_ago($row['time_upload']).' / </span> <b><a href="'.user_url_home($user['username']).'" target="_blank">'.show_username($row['user_upload'],$user['name']).'</a></b>';
											 }
										  }
										  $str.=' </div>';
										   $str.=' <div class="col-md-2">  <small>Lượt Xem :</small> <b>'.$row['solanxem'].'</b>  /   <small>Trả Lời :</small><b>150</b></div>';
										 $str.='</div>';
											
							   
							 
								$j++;
	  }
	  $str.='</div>';
	  return $str;
 
 }
 function truyen_render_chapter($data,$alias=''){
 $str='';
              
                
                								$str.='<div class="wrap-chapt-chosen" style="padding-bottom:5px">';
												$str.='<div class="col-md-6">';
		                            $str.=' <select class="form-control input-large chapt-chosen" onchange="location.href=this.value" >';
                                                        $str.='<option>Chọn Nhanh Chương</option>';
                                                     
                                                          if(count($data)>0)
                                                          foreach ($data as $row)
                                                         {
                                                        $str.='<option value="'.truyenf1_url_truyen_chuong($row['id'],$alias,$row['alias']).'">'.$row['ten'].'</option>';
                                                          }	
                      							 $str.=' </select>';
												$str.='</div>';
												$str.='<div class="col-md-6 wrap-chapt-chosen-info">';
                                                   if(count($data)>0){ $row=$data[0];
													$str.='<p class="chapt-chosen-info">Chương mới nhất:&nbsp;&nbsp; <span><a href="'.truyenf1_url_truyen_chuong($row['id'],$alias,$row['alias']).'">'.$row['ten'].'</a></span>  / '.time_ago($row['time_upload']).'</p>';
												 }
												
												$str.='</div>';
												$str.='<div class="clr"></div>';
                                                if($_SESSION['mobile']==0){
													
													
                	$str.=' <div class="truyen_list">';
					$str.='<div class="row row-chap "><div class="col-md-12">5 CHƯƠNG MỚI NHẤT</div></div>';				
					 $j=1;  
				   if(count($data)>0){
					   		   $i=1;
							   foreach ($data as $row)
							   {
								 if($j%2==0){$str.='<div class="row row-chap ">'; }else{$str.='	<div class="row row-chap ">'; }
				 						  $str.='<div class="col-md-1 item_row"> #'.$i++.'</div>';
										  $str.='<div class="col-md-6 item_row"> <span class="item_title"><i class="fa fa-book"></i> <a  href="'.truyenf1_url_truyen_chuong($row['id'],$alias,$row['alias']).'">'.$row['ten'].'</a></span></div>';
										  $str.=' <div class="col-md-3 "><small>Đăng Bởi </small> <b>'.$row['user_upload'].'</b><span><small> ,'.time_ago($row['time_upload']).'</small></div>';
										   $str.=' <div class="col-md-2">  <small>Lượt Xem :</small> <b>'.$row['solanxem'].'</b>  /   <small>Trả Lời :</small><b>150</b></div>';
										 $str.='</div>';
											
							   
							 
								$j++;
							   }
					   					   
							   
						   }else{
							 
							 $str.='<div class="alert alert-info"><h3 class="alert alert-warning" style="font-weight: lighter">Đang chờ cập nhật</h3></div>';
						
						   }
                      $str.='</div>';
               }else{//End session ko phai mobile
					 $str.='<table class="table chapt-table">';
													$str.='<thead>';
														$str.='<tr>';
															$str.='<th>Tên chapter</th>';
															$str.='<th >Ngày đăng</th>';
														
														$str.='</tr>';
													$str.='</thead>';
													$str.='<tbody>';
					 $j=1;  
				   if(count($data)>0){
					   foreach ($data as $row)
					   {
						 if($j%2==0){$str.='<tr class="item-odd">'; }else{$str.='<tr class="item-even">'; }
		 
								  $str.='<td> <a  href="'.truyenf1_url_truyen_chuong($row['id'],$alias,$row['alias']).'">'.$row['ten'].'</a></td>';
								  $str.=' <td class="hidden-xs"><span>'.time_ago($row['time_upload']).'</span></td>';
								 $str.='</tr>';
									
					   
					 
					   	$j++;
					   }
				   }else{
					    $str.=' <tr>';
                   	 $str.='<td colspan="3"><h3 class="alert alert-warning">Đang chờ cập nhật</h3></td>';
                    $str.='</tr>';
					    }
                        $str.='</table>';
                      
					  }// End session la mobile
					                             
                    $str.=' </div> ';                            
														
  		return $str;		
 
 
 }

function truyen_render_list_item($data){
	$str='';
	$k=1;
	foreach($data as $re){
		$user=get_user_by_username($re['user_upload']);
		
				if($k%2==0){
				$str.='	<div class="row">';
				}else{
				$str.='	<div class="row even">';	
				}
					$str.='<div class="col-md-5 col-xs-6 item_row">';
							$str.='<img data-original="http://sv1.mong.vn/mong/upload/'.$re['hinhanh'].'" class="lazy img-rounded pull-left" style="width:40px; height:50px; margin-right:10px; margin-top:5px"  />';
							$str.='<span class="item_title"><a href="'.truyenf1_url_truyen($re['id'],$re['alias']).'"> '.$re['ten'].' </a></span>  '; 				
							//$str.=' <br/><small>Đăng Bởi </small>   <span class="item_user">'.$re['user_upload'].'</span> <small> , '.time_ago($re['time_upload']).' </small>';	
							$str.='<Br/><span class="item_tacgia"><a href="'.truyenf1_url_truyen_tacgia(khongdau($re['tacgia'])).'">'.$re['tacgia'].'</a></span>';
							$str.=' / <span class="item_theloai">'.$re['theloai2']['2'].'</span> / <span class="item_time">'.time_ago($re['time_upload']).'</span>';
					$str.='</div>';
				    $str.='  <div class="col-md-5 col-xs-6">';
						$str.='<span class="item_chuong"><a href="'.$re['chuongmoinhat_url'].'">'.$re['chuongmoinhat'].'</a></span>';
						if($user){
						$str.='<br/><span class="item_time">'.time_ago($re['time_upload']).' bởi</span>    <a href="'.user_url_home($user['username']).'" target="_blank"><span class="item_user">'.show_username($user['username'],$user['name']).'</span></a>';
						}
					$str.='</div>';
					$str.='<div class="col-md-2 hidden-xs">';
						$str.='<small><em>Lượt Xem : </em></small>'.$re['views'];
						$str.=' <Br/><small><em>Theo Dõi :</em></small>'.$re['follows'];
					$str.='</div>';
				
              $str.=' </div>';
			  $k++;
			}
			return $str;
	}


function truyen_render_desktop_theloai($items){
	$cache=new cache;
	$str=$cache->load('list_truyen_category11','truyen',1);
	if(!$str){
	 $db=new Model2;
	 $db->query('select * from truyen_theloai  order by ten asc');
	 $data=$db->fetchAll();
	 
	 $num=count($data);
	 $rows=ceil($num/$items);
		for($i=0;$i<$rows;$i++){
				$j=$i*$items;
				$dt=array_slice($data,$j,$items);
				$str.=' <div class="grid-column grid-column3"><ul>';
				foreach($dt as $row){
						$str.='	<li><a href="'.truyenf1_url_truyen_theloai($row['id'],$row['alias']).'">'.$row['ten'].'</a></li>';
					
				}
				$str.='</ul></div>';
		}
			
	$cache->save('list_truyen_category',$str,3600,'truyen',1);	
	}
	return $str;
}